The File I/O API > The file I/O API > DWfile.copy()

 

DWfile.copy()

Availability

Dreamweaver 3.0

Description

Copies the specified file to the specified URL.

Arguments

originalURL, copyURL

The first argument is the file you want to copy, expressed as a file:// URL.
The second argument is the location where you save the copied file, expressed as a file:// URL.

Returns

true if the copy succeeded, false otherwise.

Example

The following code copies a file called myconfig.cfg to myconfig_backup.cfg.

var fileURL = "file:///c|/Config/myconfig.cfg";
var newURL ="file:///c|/Config/myconfig_backup.cfg"; 
DWfile.copy(fileURL, newURL);